package so.sao.code.service.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import so.sao.sso.bind.CurrentUserMethodArgumentResolver;

import java.util.List;

@Configuration
public class WebAppConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new CurrentUserMethodArgumentResolver());
        super.addArgumentResolvers(argumentResolvers);
    }
//    @Bean
//    //@RequestScope
//    @Scope(proxyMode = ScopedProxyMode.TARGET_CLASS, value = WebApplicationContext.SCOPE_REQUEST)
//    public ApplicationContext getApplicationContext() {
//        return new ApplicationContext();
//
//    }
}
